﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Simple_Subliminal_Messenger
{
    public partial class SubliminalDisplay : Form
    {
        Timer trr = new Timer();
        Queue<string> queue;
        public SubliminalDisplay(Queue<string> lines,int time,  double opacity)
        {
            InitializeComponent();
            this.Opacity = opacity;

            trr.Tick += trr_Tick;
            trr.Interval = time; //milisecunde
            trr.Enabled = true;
           
            //this.BackColor = Color.Magenta;
            //this.TransparencyKey = Color.Magenta;
            queue = lines;


        }
        void trr_Tick(object sender, EventArgs e)
        {

            try
            {
                string text = queue.Dequeue();
                subliminalText.Text = text;
                queue.Enqueue(text);
            }
            catch //no strings loaded yet
            {


            }
        }



    }
}
